<template>
  <div class="flex flex-col h-full">
    <SearchContainer @reset="() => formRef.resetFields()">
      <a-form ref="formRef" class="flex-1" :model="formState" :label-col="{ style: { width: '70px' } }">
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-item name="ckmc" label="仓库">
              <SelectWarehouse v-model:value="formState.ckmc" multiple max-tag-count="responsive" />
            </a-form-item>
          </a-col>
          <a-col :span="8">
            <a-form-item name="pyjm">
              <a-input v-model:value="formState.pyjm" placeholder="编号/药品名称/拼音简码/货位号" />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </SearchContainer>
    <a-card class="mt-2 flex-1">
      <BaseTable :loading="loading" :data-source="tableData" bordered fill column-code="00001007">
        <template #bodyCell="{ column, record, index }">
          <template v-if="column.dataIndex === 'xh'">
            {{ index + 1 }}
          </template>
          <template v-if="column.dataIndex === 'hwh'">
            <EditCell>
              <a-input v-model:value="record.hwh" placeholder="请输入" />
            </EditCell>
          </template>
        </template>
      </BaseTable>
    </a-card>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import EditCell from '@/components/EditCell'
// import { post } from '@/utils/request'
import SearchContainer from '@/components/SearchContainer'
import BaseTable from '@/components/BaseTable'
import SelectWarehouse from '@/components/SelectWarehouse'
import tableData from './tableData'

const loading = ref(false)
const formRef = ref(null)
const formState = ref({})
</script>
<style lang="less" scoped>
.ant-picker {
  width: 100%;
}
</style>
